package com.atguigu.exam;

import java.io.File;

/**
 * 列出当前目录下全部java文件的名称
 * @author xbd
 * @create 2021-05-30 17:08
 */
public class AllFileTest {
    public static void main(String[] args) {
        File src = new File("Day09_IO\\src\\com\\atguigu\\exam");
        String[] filenames = src.list();
        if(filenames != null){
            for(String filename : filenames){
                if(filename.endsWith(".java")){
                    System.out.println(filename);
                }
            }
        }
    }
}
